<?php

namespace app\index\controller\consulting;

use app\index\model\UM as UM;
use app\index\service\FreeConsultingService;
use app\index\traits\SubscribeMessageTemplateTrait;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * FreeConsulting 控制器
 * Class FreeConsulting
 * @package app\consulting\controller
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class FreeConsulting
{
    use SubscribeMessageTemplateTrait;

    // 请求参数
    private Request $request;

    // service
    private FreeConsultingService $service;

    public function __construct(Request $request, FreeConsultingService $freeConsultingService)
    {
        $this->request = $request;
        $this->service = $freeConsultingService;
    }

    /**
     * 免费咨询
     * @param \app\index\model\UM $user
     * @return ApiResponse
     * @url /consulting/free_consulting/save
     * @deprecated
     */
    // public function save(UM $user): ApiResponse
    // {
    //     $request = $this->request;
    //
    //     $data = $this->service->add($user, $request->param());
    //
    //     // 返回客户端订阅消息
    //     $data['subscribe_message_templates'] = $this->getConsultingSubscribeMessageTemplates();
    //
    //     return ApiResponse::success($data);
    // }

}
